cmake_minimum_required(VERSION 2.6)
set( CMAKE_VERBOSE_MAKEFILE on )
project(megadepth)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -DMEGADEPTH_VERSION=\"\\\"`cat ../VERSION`\\\"\"")
add_executable(megadepth_dynamic megadepth.cpp)
add_executable(megadepth_static megadepth.cpp)
add_executable(megadepth_statlib megadepth.cpp)
include_directories(include)

find_package(Threads REQUIRED)
if(THREADS_HAVE_PTHREAD_ARG)
    set_property(TARGET megadepth_dynamic PROPERTY COMPILE_OPTIONS "-pthread")
    set_property(TARGET megadepth_dynamic PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
endif()
if(CMAKE_THREAD_LIBS_INIT)
    target_link_libraries(megadepth_dynamic "${CMAKE_THREAD_LIBS_INIT}")
endif()

target_link_libraries(megadepth_dynamic z hts BigWig deflate -L${CMAKE_SOURCE_DIR}/lib)
